< previous page page_316 next page >

Page 316
Tracking Child Windows
Visual Basic has the capability to keep track of the list of child windows open within the parent MDI form. To create this list, set the WindowList property of a menu item to True.
EXERCISE
Adding a Windowlist
1. Open frmMain in design mode.
2. Open the menu design window.
3. Click the Window menu item.
4. Check the WindowList property.
5. Run the application. Open a few of the child forms and then click the Window menu to see a list of open forms.
analysis.gifA list of open windows is typical of most MDI applications. Be sure to add this to your MDI applications by setting the WindowList property.

Creating Pop-up Menus
In many applications, you can click the right mouse button at certain locations to cause context-sensitive menus to appear. These menus give you the ability to perform certain actions based on where youve clicked.
To create a pop-up menu, you need to create a top-level menu group with its Visible property set to False. You can create as many subitems as you want under this menuthese are the items that will be displayed on the pop-up menu.
In an MDI application, you need to create the pop-up menus on the main MDI form only. If you dont, any child form menus will replace the MDI forms menu at runtime. This can make things quite a challenge to program; therefore, you should create all menus on just the MDI form. This includes all the pop-up menus youll use throughout your application. If you want to create a pop-up menu on the Employee Information form, you need to reference the menu on the frmMain MDI form.

 
< previous page page_316 next page >

If you like this book, buy it!